<table id="userpwgen" class="admingrid">
</table>
<div id="userpwgen_pager"></div>
<button id="generate" onclick="generateUsers()">Generate usernames</button>

<script>
grids.userpwgen = {
/*
    url : generateServiceUrl({
        admin : true,
        service : "getnousercompanies",
        page : "maintenance"
    }),
*/
    colNames : [
        "Company name",
        "Address",
        "Contact email",
        "Contact person",
        "Homepage (en)",
        "Homepage (hu)"
    ],
    colModel : [
        { name : "company_name",  index : "company_name",  width : 150 },
        { name : "address",       index : "address",       width : 150 },
        { name : "email",         index : "email",         width : 150 },
        { name : "contactperson", index : "contactperson", width : 100 },
        { name : "hpenglish",     index : "hpenglish",     width : 100 },
        { name : "hphungarian",   index : "hphungarian",   width : 100 }
    ],
    caption : "Companies without username"
};

function generateUsers() {
    jQuery("button[id='generate']").attr("disabled", true);
    callAdminService("maintenance", "generateusers", {}, {
        success : function(result) {
            displayMessage("info", "Usernames and passwords are now generated");
            refreshGrid("userpwgen");
            jQuery("button[id='generate']").attr("disabled", false);
        }
    });
}

</script>
